package com.contract.management.web;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice
public class DefaultExceptionHandler {
	
	@ExceptionHandler(value=Exception.class)
	public String defaultErrorHandler(Exception e, Model model) {
		model.addAttribute("title", "错误信息");
		model.addAttribute("text", e.getMessage());
		model.addAttribute("type", "error");
		return "show_message";
	}
}
